import {
  menuAddUrl,
  menuDeleteUrl,
  menuOptionsUrl,
  menuUpdateUrl,
  menuListUrl,
  getRoutesUrl,
} from "../index";
import axios from "@/utils/request";
export function getMenuOptionsRequest<T>(params?: any): Promise<T> {
  return axios.get(menuOptionsUrl, params);
}

export function menuAddRequest<T>(params?: any): Promise<T> {
  return axios.post(menuAddUrl, params);
}
export function menuDeleteRequest<T>(params?: any): Promise<T> {
  return axios.delete(menuDeleteUrl + "/" + params.id, params);
}

export function menuUpdateRequest<T>(params?: any): Promise<T> {
  return axios.post(menuUpdateUrl, params);
}
export function getMenuListRequest<T>(params?: any): Promise<T> {
  return axios.get(menuListUrl, params);
}

export function getRoutesRequest<T>(params?: any): Promise<T> {
  return axios.get(getRoutesUrl, { params });
}
